
use "RAP_replication.dta", clear

svyset [weight=teamweight]


**************
***Figure 1***
**************

twoway histogram CC22_440a, discrete fcolor(black%70) width(1) lc(black%70) xtitle("") scheme(sj) graphregion(color(white) margin(zero)) ylabel(0 (25) 75) percent title(Denial of white privilege) xlabel(1 "Str. Disagree" 2 "Disagree" 3 "Neither" 4 "Agree" 5 "Str. Agree", labsize(small))
graph save "whiteprivilege.gph", replace

twoway histogram CC22_440b, discrete fcolor(black%70) width(1) lc(black%70) xtitle("") scheme(sj) graphregion(color(white) margin(zero)) ylabel(0 (25) 75) percent title(Racial problems are rare) xlabel(1 "Str. Disagree" 2 "Disagree" 3 "Neither" 4 "Agree" 5 "Str. Agree", labsize(small))
graph save "racialproblems.gph", replace

twoway histogram CC22_441a, discrete fcolor(black%70) width(1) lc(black%70) xtitle("") scheme(sj) graphregion(color(white) margin(zero)) ylabel(0 (25) 75) percent title(Blacks should work their way up) xlabel(1 "Str. Disagree" 2 "Disagree" 3 "Neither" 4 "Agree" 5 "Str. Agree", labsize(small))
graph save "workwayup.gph", replace

twoway histogram CC22_441b, discrete fcolor(black%70) width(1) lc(black%70) xtitle("") scheme(sj) graphregion(color(white) margin(zero)) ylabel(0 (25) 75) percent title(Denial of systemic racism) xlabel(1 "Str. Disagree" 2 "Disagree" 3 "Neither" 4 "Agree" 5 "Str. Agree", labsize(small))
graph save "systemicracism.gph", replace

gr combine whiteprivilege.gph racialproblems.gph workwayup.gph systemicracism.gph


**************
***Figure 2***
**************

twoway histogram CC22_440c, discrete fcolor(black%70) width(1) lc(black%70) xtitle("") scheme(sj) graphregion(color(white) margin(zero)) ylabel(0 (20) 60) percent title(Women seek to gain power) xlabel(1 "Str. Disagree" 2 "Disagree" 3 "Neither" 4 "Agree" 5 "Str. Agree", labsize(small))
graph save "womenpower.gph", replace

twoway histogram CC22_440d, discrete fcolor(black%70) width(1) lc(black%70) xtitle("") scheme(sj) graphregion(color(white) margin(zero)) ylabel(0 (20) 60) percent title(Women are too easily offended) xlabel(1 "Str. Disagree" 2 "Disagree" 3 "Neither" 4 "Agree" 5 "Str. Agree", labsize(small))
graph save "womenoffended.gph", replace

gr combine womenpower.gph womenoffended.gph


*************
***Table 1***
*************

factor longfor feelnostalgia usculture uspolsystem useconsystem betterplace, pcf
rotate


**************
***Figure 3***
**************

svy: ologit CC22_440a c.nostalgia  pid7 ideo5 faminc_new educ cat_age woman hispanic i.race3
eststo whiteprivilege
svy: ologit CC22_440b nostalgia pid7 ideo5 faminc_new educ cat_age woman hispanic i.race3
eststo racialproblems 
svy: ologit CC22_441a nostalgia pid7 ideo5 faminc_new educ cat_age woman hispanic i.race3
eststo workwayup
svy: ologit CC22_441b nostalgia pid7 ideo5 faminc_new educ cat_age woman hispanic i.race3
eststo systemicracism

coefplot (whiteprivilege) || (racialproblems) || (workwayup) || (systemicracism), xline(0, lc(red)) scheme(s1mono) 


**************
***Figure 4***
**************

svy: ologit CC22_440c nostalgia pid7 ideo5 faminc_new educ cat_age woman hispanic i.race3 
eststo womenpower 
svy: ologit CC22_440d nostalgia pid7 ideo5 faminc_new educ cat_age woman hispanic i.race3 
eststo womenoffended 

coefplot (womenpower) || (womenoffended), xline(0, lc(red)) scheme(s1mono) 









*************APPENDIX*************



**************
***Table A1***
**************

esttab whiteprivilege racialproblems workwayup systemicracism using "A1_table.tex", se r2 scalars(chi2) starlevels($^+$ 0.1 $^*$ 0.05 $^{**}$ 0.01) label replace


**************
***Table A2***
**************

esttab womenpower womenoffended using "A2_table.tex", se r2 scalars(chi2) starlevels($^+$ 0.1 $^*$ 0.05 $^{**}$ 0.01) label replace


**************
***Table A3***
**************

svy: ologit CC22_440a nostalgia pid7 ideo5 faminc_new educ cat_age woman hispanic if race3==1
eststo whiteprivilege_a3
svy: ologit CC22_440b nostalgia pid7 ideo5 faminc_new educ cat_age woman hispanic if race3==1
eststo racialproblems_a3
svy: ologit CC22_441a nostalgia pid7 ideo5 faminc_new educ cat_age woman hispanic if race3==1
eststo workwayup_a3
svy: ologit CC22_441b nostalgia pid7 ideo5 faminc_new educ cat_age woman hispanic if race3==1
eststo systemicracism_a3

esttab whiteprivilege_a3 racialproblems_a3 workwayup_a3 systemicracism_a3 using "A3_table.tex", se r2 scalars(chi2) starlevels($^+$ 0.1 $^*$ 0.05 $^{**}$ 0.01) label replace


**************
***Table A4***
**************

svy: ologit CC22_440c nostalgia pid7 ideo5 faminc_new educ cat_age hispanic i.race3 if woman==0
eststo womenpower_a4
svy: ologit CC22_440d nostalgia pid7 ideo5 faminc_new educ cat_age hispanic i.race3 if woman==0
eststo womenoffended_a4 

esttab womenpower_a4 womenoffended_a4 using "A4_table.tex", se r2 scalars(chi2) starlevels($^+$ 0.1 $^*$ 0.05 $^{**}$ 0.01) label replace


**************
***Table A5***
**************

estpost corr nostalgia authoritarianism racism sexism pid7 ideo5 faminc_new educ cat_age hispanic black other woman
eststo correlations
esttab correlations using "A5_table.tex", unstack b(2) label replace


**************
***Table A6***
**************

ologit CC22_440a nostalgia_alt pid7 ideo5 faminc_new educ cat_age woman hispanic i.race3 [pweight=teamweight]
eststo whiteprivilegeA3_1
ologit CC22_440a longfor pid7 ideo5 faminc_new educ cat_age woman hispanic i.race3 [pweight=teamweight]
eststo whiteprivilegeA3_2
ologit CC22_440a nostalgia_open pid7 ideo5 faminc_new educ cat_age woman hispanic i.race3 [pweight=teamweight]
eststo whiteprivilegeA3_3
ologit CC22_440b nostalgia_alt pid7 ideo5 faminc_new educ cat_age woman hispanic i.race3 [pweight=teamweight]
eststo racialproblemsA3_1
ologit CC22_440b longfor pid7 ideo5 faminc_new educ cat_age woman hispanic i.race3 [pweight=teamweight]
eststo racialproblemsA3_2
ologit CC22_440b nostalgia_open pid7 ideo5 faminc_new educ cat_age woman hispanic i.race3 [pweight=teamweight]
eststo racialproblemsA3_3
ologit CC22_441a nostalgia_alt pid7 ideo5 faminc_new educ cat_age woman hispanic i.race3 [pweight=teamweight]
eststo workwayupA3_1
ologit CC22_441a longfor pid7 ideo5 faminc_new educ cat_age woman hispanic i.race3 [pweight=teamweight]
eststo workwayupA3_2
ologit CC22_441a nostalgia_open pid7 ideo5 faminc_new educ cat_age woman hispanic i.race3 [pweight=teamweight]
eststo workwayupA3_3
ologit CC22_441b nostalgia_alt pid7 ideo5 faminc_new educ cat_age woman hispanic i.race3 [pweight=teamweight]
eststo systemicracismA3_1
ologit CC22_441b longfor pid7 ideo5 faminc_new educ cat_age woman hispanic i.race3 [pweight=teamweight]
eststo systemicracismA3_2
ologit CC22_441b nostalgia_open pid7 ideo5 faminc_new educ cat_age woman hispanic i.race3 [pweight=teamweight]
eststo systemicracismA3_3

esttab whiteprivilegeA3_1 whiteprivilegeA3_2 whiteprivilegeA3_3 racialproblemsA3_1 racialproblemsA3_2 racialproblemsA3_3 workwayupA3_1 workwayupA3_2 workwayupA3_3 systemicracismA3_1 systemicracismA3_2 systemicracismA3_3 using "A6_table.tex", se r2 scalars(chi2) starlevels($^+$ 0.1 $^*$ 0.05 $^{**}$ 0.01) label replace


**************
***Table A7***
**************

ologit CC22_440c nostalgia_alt pid7 ideo5 faminc_new educ cat_age woman hispanic i.race3 [pweight=teamweight]
eststo womenpowerA4_1
ologit CC22_440c longfor pid7 ideo5 faminc_new educ cat_age woman hispanic i.race3 [pweight=teamweight]
eststo womenpowerA4_2
ologit CC22_440c nostalgia_open pid7 ideo5 faminc_new educ cat_age woman hispanic i.race3 [pweight=teamweight]
eststo womenpowerA4_3
ologit CC22_440d nostalgia_alt pid7 ideo5 faminc_new educ cat_age woman hispanic i.race3 [pweight=teamweight]
eststo womenoffendedA4_1
ologit CC22_440d longfor pid7 ideo5 faminc_new educ cat_age woman hispanic i.race3 [pweight=teamweight]
eststo womenoffendedA4_2
ologit CC22_440d nostalgia_open pid7 ideo5 faminc_new educ cat_age woman hispanic i.race3 [pweight=teamweight]
eststo womenoffendedA4_3

esttab womenpowerA4_1 womenpowerA4_2 womenpowerA4_3 womenoffendedA4_1 womenoffendedA4_2 womenoffendedA4_3 using "A7_table.tex", se r2 scalars(chi2) starlevels($^+$ 0.1 $^*$ 0.05 $^{**}$ 0.01) label replace


**************
***Table A8***
**************

ologit CC22_440a era simpler economics politics politics_left politics_right politeness technology crime [pweight=teamweight]
est sto openend_privilege
ologit CC22_440b era simpler economics politics politics_left politics_right politeness technology crime [pweight=teamweight]
est sto openend_problems
ologit CC22_441a era simpler economics politics politics_left politics_right politeness technology crime [pweight=teamweight]
est sto openend_workwayup
ologit CC22_441b era simpler economics politics politics_left politics_right politeness technology crime [pweight=teamweight]
est sto openend_systemic
ologit CC22_440c era simpler economics politics politics_left politics_right politeness technology crime  [pweight=teamweight]
est sto openend_power
ologit CC22_440d era simpler economics politics politics_left politics_right politeness technology crime [pweight=teamweight]
est sto openend_offended

esttab openend_privilege openend_problems openend_workwayup openend_systemic openend_power openend_offended using "A8_table.tex", se r2 scalars(chi2) starlevels($^+$ 0.1 $^*$ 0.05 $^{**}$ 0.01) label replace


**************
***Table A9***
**************

ologit CC22_440a nostalgia pessimism pid7 ideo5 faminc_new educ cat_age woman hispanic i.race3 [pweight=teamweight]
est sto privilege_pessimism

ologit CC22_440b nostalgia pessimism pid7 ideo5 faminc_new educ cat_age woman hispanic i.race3 [pweight=teamweight]
est sto problems_pessimism

ologit CC22_441a nostalgia pessimism pid7 ideo5 faminc_new educ cat_age woman hispanic i.race3 [pweight=teamweight]
est sto workwayup_pessimism

ologit CC22_441b nostalgia pessimism pid7 ideo5 faminc_new educ cat_age woman hispanic i.race3 [pweight=teamweight]
est sto systemic_pessimism

ologit CC22_440c nostalgia pessimism pid7 ideo5 faminc_new educ cat_age woman hispanic i.race3 [pweight=teamweight]
est sto power_pessimism

ologit CC22_440d nostalgia pessimism pid7 ideo5 faminc_new educ cat_age woman hispanic i.race3 [pweight=teamweight]
est sto offended_pessimism

esttab privilege_pessimism problems_pessimism workwayup_pessimism systemic_pessimism power_pessimism offended_pessimism using "A9_table.tex", se scalars(r2_p chi2) starlevels($^+$ 0.1 $^*$ 0.05 $^{**}$ 0.01) label replace


***************
***Figure A1***
***************

twoway histogram CC22_440a if race3==1, discrete fcolor(gray%50) width(1) lc(gray%50) || histogram CC22_440a if race3==2, discrete fcolor(black%70) width(1) lc(black%70) legend(order(1 "White" 2 "Black")) xtitle(Denial of white privilege) scheme(sj) graphregion(color(white))
graph save "whiteprivilege_a1.gph", replace

twoway histogram CC22_440b if race3==1, discrete fcolor(gray%50) width(1) lc(gray%50) || histogram CC22_440b if race3==2, discrete fcolor(black%70) width(1) lc(black%70) legend(order(1 "White" 2 "Black")) xtitle(Racial problems are rare) scheme(sj) graphregion(color(white))
graph save "racialproblems_a1.gph", replace

twoway histogram CC22_441a if race3==1, discrete fcolor(gray%50) width(1) lc(gray%50) || histogram CC22_441a if race3==2, discrete fcolor(black%70) width(1) lc(black%70) legend(order(1 "White" 2 "Black")) xtitle(Blacks should work their way up) scheme(sj) graphregion(color(white))
graph save "workwayup_a1.gph", replace

twoway histogram CC22_441b if race3==1, discrete fcolor(gray%50) width(1) lc(gray%50) || histogram CC22_441b if race3==2, discrete fcolor(black%70) width(1) lc(black%70) legend(order(1 "White" 2 "Black")) xtitle(Denial of systemic racism) scheme(sj) graphregion(color(white))
graph save "systemicracism_a1.gph", replace

grc1leg whiteprivilege_a1.gph racialproblems_a1.gph workwayup_a1.gph systemicracism_a1.gph


***************
***Figure A2***
***************

twoway histogram CC22_440c if woman==0, discrete fcolor(gray%50) width(1) lc(gray%50) || histogram CC22_440c if woman==1, discrete fcolor(black%70) width(1) lc(black%70) legend(order(1 "Man" 2 "Woman")) xtitle(Women seek to gain power) scheme(sj) graphregion(color(white))
graph save "womenpower_a2.gph", replace

twoway histogram CC22_440d if woman==0, discrete fcolor(gray%50) width(1) lc(gray%50) || histogram CC22_440d if woman==1, discrete fcolor(black%70) width(1) lc(black%70) legend(order(1 "Man" 2 "Woman")) xtitle(Women are too easily offended) scheme(sj) graphregion(color(white))
graph save "womenoffended_a2.gph", replace

grc1leg womenpower_a2.gph womenoffended_a2.gph

